#ifndef CODBC_H
#define CODBC_H
#include <windows.h>
#include <odbcinst.h>
#include <sqlext.h>
#include <string>
#include <stdio.h>
#include <vector>
using namespace std;

class cODBC
{
    public:
        cODBC(string driver);
        virtual ~cODBC();
        bool Connect();
        bool InstallDriver(string path,string dll);
        bool DriverInstalled();
        void SetLogin(string login,string Mdp);
        void SetAdresse(string adresse,unsigned int port);
        void SetDriver(string driver);
        bool Query(string requete);
        bool Fetch();
        int GetInt(int col);
        string GetString(int col);
        bool GetColumnName(int col,string & nom);
        bool GetColumnType(int i,int & type);
        void Disconnect();
        string GetError();
    protected:
    private:
        string  _Login;
        string  _Mdp;
        string  _Adresse;
        string  _driver;
        unsigned int     _Port;

        SQLHENV henv;
        SQLHDBC hdbc;
        SQLHSTMT hstmt;
        SQLRETURN retcode;

};

#endif // CODBC_H
